package com.wang.mapper;

import com.wang.pojo.Attention;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Entity com.wang.pojo.Attention
 */
@Mapper
public interface AttentionMapper extends BaseMapper<Attention> {
    @Update("update tb_attention set del_flag=1 where user_id=#{userId} and specialist_id=#{specialistId} ")
    void cancelAttention(Attention attention);

    @Select("select count(attention_id) from tb_attention where user_id=#{userId} and specialist_id=#{specialistId}   ")
    Integer doYouAttention(@Param("specialistId") Integer specialistId, @Param("userId") Integer userId);

    @Update("update tb_attention set del_flag=0 where user_id=#{userId} and specialist_id=#{specialistId} ")
    void addAttention(@Param("specialistId")Integer specialistId, @Param("userId")Integer userId);
}




